package cn.picclife.mwx.manager.sys.service;

import java.io.File;
import java.text.ParseException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import cn.picclife.mwx.manager.sys.model.bo.DataResponse;
import cn.picclife.mwx.manager.sys.model.bo.PageCount;
import cn.picclife.mwx.manager.sys.model.bo.SaveCollectRequest;
import cn.picclife.mwx.manager.sys.model.bo.TrackBo;
import cn.picclife.mwx.manager.sys.model.bo.UpdateCollectReq;
import cn.picclife.mwx.manager.sys.model.po.DataCollect;
import cn.picclife.mwx.manager.sys.model.po.DataCollectUser;

public interface CollectDataService {

	/**
	 * 将采集数据保存至文件，并将信息插入表中
	 * @param req
	 * @throws Exception
	 */
	public void saveData(SaveCollectRequest req) throws Exception;
	
	/**
	 * 更新数据采集库信息
	 * @param req
	 * @return 0-失败 1-成功
	 * @throws Exception
	 */
	public int updateData(UpdateCollectReq req) throws Exception;
	
	/**
	 * 查询视频播放文件信息
	 * @return
	 */
	public List<String> queryDataFile(UpdateCollectReq req) throws Exception;
	
	/**
	 * 查询视频播放列表
	 * @param req
	 * @return
	 */
	public PageCount queryDataList(UpdateCollectReq req,String deptNo);
//	public PageCount queryDataList(UpdateCollectReq req);
	
	/**
	 * 查询用户播放记录
	 * @param datacollectId
	 * @return
	 */
	public List<DataCollectUser> queryUserList(String datacollectId,HttpServletRequest request);

	/**
	 *  保存数据
	 * @param bo
	 * @return
	 */
	public DataResponse insertTrack(TrackBo bo) throws Exception;
	

	/**
	 * 根据CollectId查询操作轨迹
	 * @param shot
	 * @return
	 */
	public DataResponse queryTrackByCollectId(TrackBo shot) throws Exception;
	
	/**
	 * 完成录制功能
	 * @return 
	 * @throws ParseException 
	 * @throws Exception 
	 */
	public DataResponse finishRecord(SaveCollectRequest req) throws Exception;
	/**
	 * 查询审批和申请记录
	 * @param req
	 * @return
	 */
	public DataResponse queryApplyRecord(UpdateCollectReq req);
	
	/**
	 * 下载html
	 * @param req
	 * @throws Exception 
	 */
	public void downloadFile(SaveCollectRequest req) throws Exception;
	
	/**
	 * 下载html
	 * @param req
	 * @throws Exception 
	 */
	public DataResponse compareHtml(SaveCollectRequest req) throws Exception;
	
	/**
	 * 检查是否要下载
	 * @return
	 */
	public DataResponse checkFile(SaveCollectRequest req);
	
	
	public void updateFile(String url,String data) throws Exception ;
	
	public void createFile(String url,String data) throws Exception;
	
	/**
	 * 对比html是否下载
	 * @param req
	 * @return
	 */
	public DataResponse compareHtml_new(SaveCollectRequest req) ;
	
	/**
	 * 判断是否对比html
	 */
	public DataResponse isNotCompareHtml(String sysCode);
	
	/**
	 * 判断js是否需要下载
	 * @param req
	 * @return
	 */
	public DataResponse compareJS(SaveCollectRequest req);
	
	/**
	 * 下载静态资源
	 * @param req
	 * @return
	 */
	public DataResponse downloadStaticFile(SaveCollectRequest req) ;
	
	/**
	 * 比对html和js
	 * @param req
	 * @return
	 */
	public DataResponse compare(SaveCollectRequest req);
	
	/**
	 * 保存并下载js
	 * @param req
	 */
	public void downloadJS(SaveCollectRequest req,String newVersionId) ;
	
	/**
	 * 根据采集表id或业务号获取视频回放插件信息
	 */
	public DataCollect queryPluginData(String id,String bussinessNo);
	
	/**
	 * 处理山东城商联盟文件
	 */
	public void unZipStatic(SaveCollectRequest req) ;

	public int uploadTxt(String buffer, UpdateCollectReq req);

    int uploadZip(List<File> files, List<UpdateCollectReq> req, String path, String filePath, List<String> uuidStringList, String aseString);

	public void deleteFailData(List<String> idList);

	boolean compareDownloadStaticLine(List<String> list, String s, String s1);
}
